// Facebook
(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) return;
  js = d.createElement(s); js.id = id;
  js.src = &quot;//connect.facebook.net/id_ID/all.js#xfbml=1&amp;appId=473675066009338&quot;;
  fjs.parentNode.insertBefore(js, fjs);
}(document, &#39;script&#39;, &#39;facebook-jssdk&#39;));

// Of page
$(function() {
    var siteURL = &quot;http://&quot; + top.location.host.toString();
    var $internalLinks = $(&quot;a[href^=&#39;&quot;+siteURL+&quot;&#39;], a[href^=&#39;/&#39;], a[href^=&#39;./&#39;], a[href^=&#39;../&#39;], a[href^=&#39;#&#39;]&quot;);
    $internalLinks.filter(&#39;:not([target=&quot;_blank&quot;])&#39;).click(function() {
        $(&#39;#page-animasi&#39;).fadeIn(1500).delay(6000).fadeOut(1000);
    });
});

// Thread comment form
	var source = ($commentEditor.length) ? $commentEditor.attr('src').split('#') : "";
	$ansButton.on("click", function() {
		$alertBox.hide();
		$commentEditor.css('opacity', 0);
		$ansButton.removeClass('clicked');
		$(this).addClass('clicked');
		var start = source[0], end = source[1],
			replyFrame = start + '&parentID=' + $(this).data('rel').substr(1) + '#' + end,
			$goTo = $(this).closest('.cm_wrap');
		$commentForm.appendTo($goTo);
		$viewPort.scrollTop($goTo.offset().top - 30);
		$loadingText.html('<span>Memuat...</span>');
		$commentEditor.attr('src', replyFrame).on("load", function() {
			$(this).css('opacity', 1);
			$loadingText.html('');
		});
		return false;
	});
	$myComments.on("click", "#cancel-answer", function() {
		var ofs = $('#comment-editor-src').attr('href');
		$loadingText.html('<span>Memuat...</span>');
		$commentForm.appendTo($myComments);
		$commentEditor.css('opacity', 0).attr('src', ofs + '#' + source[1]).on("load", function() {
			$(this).css('opacity', 1);
			$loadingText.html('');
		});
		$ansButton.removeClass('clicked');
		return false;
	});
	$fiddleScreen.each(function(url) {
		url = $(this).data('src');
		$(this).replaceWith('<iframe class="jsfiddle-demo loader" src="' + url + '"></iframe>');
	});
   
   
